package com.springboot.erp;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.springboot.erp.entity.JshDepot;
import com.springboot.erp.mapper.JshDepotMapper;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;

@SpringBootTest
@Slf4j
public class testDepot {
    @Resource
    private JshDepotMapper jshDepotMapper;
    @Test
    public void testselectForPages() {
        Page<JshDepot> page = new Page<>(1, 5);
        OrderItem orderItem =  OrderItem.desc("id");
        page.addOrder(orderItem);
        Page<JshDepot> page2 =jshDepotMapper.selectForPagesD("仓库",null, page);
        log.info("total:{}", page2.getPages());
        log.info("total:{}", page2.getTotal());
        log.info("current:{}", page2.getCurrent());
        log.info("size:{}", page2.getSize());
        log.info("records:{}", page2.getRecords());
    }

}
